/* -*- mode: c++; coding: utf-8-unix -*-
 */

#ifndef _CONFIGURATION_H
#define _CONFIGURATION_H

#include <list>
#include <string>

namespace cfg
{

	enum Mode { UnspecifiedMode = 0, DFT = 1, DCT = 2 };
	enum Channel { Red, Green, Blue, Gray };
	enum Subchannel { Real, Imaginary, Magnitude, Phase };
	enum OutputType { UnspecifiedType = 0, Grayscale = 1, Merged = 2};
	
	struct ChannelSpec
	{
		std::string name;
		Channel channel;
		Subchannel subchannel;
	};	
	bool operator<(const ChannelSpec &one, const ChannelSpec &other);
	bool operator==(const ChannelSpec &one, const ChannelSpec &other);

	typedef std::list<ChannelSpec> channel_list;
	typedef channel_list::iterator chlist_iterator;
	typedef channel_list::const_iterator chlist_citerator;

	class Config
	{
		struct PImp;
		PImp *_pimp;

	public:
		Config(int argc, char **argv);
		virtual ~Config();

		Mode mode() const;
		OutputType outputType() const;
		size_t threadcount() const;
		size_t framesize() const;
		const channel_list& selectedChannels() const;
		const std::string& infile() const;
		const std::string& outfile() const;
		const std::string& outfile(ChannelSpec ch) const;
		size_t outWidth() const;
		size_t outHeight() const;
		double squeeze() const;
		bool center() const;

		std::string toString() const;
	};
}

#endif //_CONFIGURATION_H
